//
//  SQCustomButton.h
//  SQCustomButton
//
//  Created by yangsq on 2017/9/12.
//  Copyright © 2017年 yangsq. All rights reserved.
//

#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger,SQCustomButtonType) {
    SQCustomButtonLeftImageType,//左图标，右文字
    SQCustomButtonTopImageType,//上图标，下文字
    SQCustomButtonRightImageType//右图标，左文字
};



@interface SQCustomButton : UIView
/** 背景图片 */
@property (nonatomic, strong) UIImageView * SQBackimageView;
/** 图片 */
@property (nonatomic, strong) UIImageView *imageView;
/** 标题 */
@property (nonatomic, strong) UILabel *titleLabel;
/** 标题文字 */
@property (nonatomic , copy) NSString * text;
/** 图片 */
@property (nonatomic, strong) UIImage *image;
/** font */
@property (nonatomic, strong) UIFont *font;
/** font */
@property (nonatomic, strong) UIColor * textColor;
/** 按钮 */
@property (nonatomic, strong) UIButton * SQTouchBtn;
/** 是否展示点击效果 */
@property (nonatomic, assign) BOOL isShowSelectBackgroudColor;
/** 是否展示点击效果 yes就不展示 */
@property (nonatomic, assign) BOOL isShowSelect;
//按钮的selected
@property (nonatomic , assign) BOOL ButtonSelected;
//改变选中效果图片的值
@property (nonatomic , assign) BOOL selecredImage;
//该按钮记录的特殊值
@property (nonatomic , copy) NSString * tagSting;
//按钮的selected
@property (nonatomic , assign) BOOL isModified;
@property (nonatomic, copy)void(^touchBlock)(SQCustomButton *button);




/* 
 初始化
 imageSize  图标大小
 isAutoWidth 是否根据文字长度自适应
 */
- (id)initWithFrame:(CGRect)frame
               type:(SQCustomButtonType)type
          imageSize:(CGSize)imageSize
          midmargin:(CGFloat)midmargin;

/*
 初始化
 imageSize  图标大小
 isAutoWidth 是否根据文字长度自适应
 */
- (id)initType:(SQCustomButtonType)type
          imageSize:(CGSize)imageSize
          midmargin:(CGFloat)midmargin;

//点击响应
- (void)touchAction:(void(^)(SQCustomButton *button))block;


/// 切换图片
/// @param selectedImage 图片
/// @param unselected 未选择图片
-(void)SQbuttonClickImage:(NSString*)selectedImage unSelected:(NSString*)unselected;
 

NS_ASSUME_NONNULL_END

@end
